package com.domi.controller;

import com.domi.bean.RestfulResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HelloConsumerController {

    @Autowired
    private RestTemplate restTemplate; // springboot 默认提供

    @GetMapping("/")
    public RestfulResponse index() {
        RestfulResponse response = restTemplate.getForObject("http://user-center/user/", RestfulResponse.class);
        return response;
    }

}